<form action="<?php echo Route::url('admin',array('controller' => 'land', 'action' => 'manage')); ?>" method="post">
				
	<fieldset> <!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns -->
		
		<p>
			<?php if($land->state() == Doctrine_Record::STATE_CLEAN):?>
				<input type="hidden" name="id" value="<?php echo $land->id; ?>" />
			<?php endif;?>
		</p>
		
		<p>
			<label>Tiêu đề</label>
			<input class="text-input large-input" type="text" name="title" value="<?php echo $land->title; ?>" />
		</p>
		
        <p>
			<label>Trạng thái</label>
            <select name="status">
                <?php foreach(Libs_Land::getInstance()->get_land_status_as_array() as $key => $value): ?>
                <option <?php if($land->status == $key){ echo 'selected'; } ?> value="<?php echo $key; ?>"><?php echo $value; ?></option>
                <?php endforeach; ?>
            </select>
		</p>
        
		<p>
			<label>Mô tả ngắn</label>
			<textarea class="text-input textarea" name="short_description" cols="79" rows="5"><?php echo $land->short_description; ?></textarea>
		</p>
		
		<p>
			<label>
				Hướng
				<select name="direction">
                    <option>Bất kỳ</option>
                    <?php foreach(Direction::get_direction() as $key => $direc): ?>
                        <option <?php if($land->direction == $key){echo 'selected';}?> value="<?php echo $key; ?>"><?php echo $direc; ?></option>
                    <?php endforeach; ?>
				</select>
				
				Loại giao dịch              
				<select name="transaction_type">
                    <option  value="">Bất kỳ</option>
                    <option <?php if($land->transaction_type == 'rent'){ echo "selected"; }?> value="rent">Cho thuê</option>
                    <option <?php if($land->transaction_type == 'lease'){ echo "selected"; }?> value="lease">Cần mua</option>
                    <option <?php if($land->transaction_type == 'sold'){ echo "selected"; }?> value="sold">Cần bán</option>
				</select> 
			</label>              
		</p>
		
		<p>
			<label style="float:left; width:50%">Tên liên hệ <input class="text-input" style="width: 50%; float: right; margin-right: 10px" type="text" name="contact_name" value="<?php echo $land->contact_name; ?>" /></label>
            
            <label style="float:left; width: 50%">Điện thoại liên hệ <input class="text-input" style="width: 50%; float: right" type="text" name="contact_phone" value="<?php echo $land->contact_phone; ?>" /></label>
		</p>
		
        <div class="clear"></div>
        
		<p>
			<label style="float:left; width: 50%">
				Giá
                <input class="text-input" style="width: 50%; float: right; margin-right: 10px" type="text" name="price" value="<?php echo $land->price; ?>"/><em>(₫)</em>&nbsp;
			</label>
            
            <label style="float:left; width: 50%">
                Diện tích
                <input class="text-input" style="width: 50%; float: right" type="text" name="area" value="<?php echo $land->area; ?>" /><em>(m&sup2;)</em>
            </label>
			
		</p>
		
		<p>
			<label>Địa điểm</label>
			<select name="location_id">
				<?php foreach($location as $l):?>
				<option value="<?php echo $l->id; ?>" <?php if($land->Location->id == $l->id){ echo "selected"; } ?>><?php echo $l->name; ?></option>
				<?php endforeach;?>
			</select>
		</p>	
		
        <p>
            <label>Loại bất động sản</label>
            <select name="land_type">
                <?php foreach(Libs_Land::getInstance()->get_land_type() as $type): ?>
                <option <?php if($land->land_type_id == $type['id']){echo 'selected';} ?> value="<?php echo $type['id'] ?>"><?php echo $type['name'] ?></option>
                <?php endforeach; ?>
            </select>
        </p>
        
		<p>
			<label>Mô tả</label>
			<textarea class="text-input textarea tinymce" style="height: 400px" name="description" cols="79" rows="15"><?php echo $land->description; ?></textarea>
		</p>		
		
		<p>
			<input class="button" type="submit" value="Lưu" />
			
			<?php if($land->state() == Doctrine_Record::STATE_CLEAN):?>
				<input class="button" type="button" onclick="javascript:history.go(-1)" value="Hủy" />
			<?php endif;?>
		</p>			
	</fieldset>
	
	<div class="clear"></div><!-- End .clear -->
	
</form>
<script type="text/javascript">
$(document).ready(function(){

});
</script>